extend ../layout
block append css
    link(rel="stylesheet" href="/duimen/css/index.css")
    link(rel="stylesheet" href="/duimen/css/detail.css")
    link(rel="stylesheet" href="/duimen/css/swiper.min.css")
    link(rel="stylesheet" href="/duimen/css/vote.css")

block content
    style body{background-color:#f7f7f7;padding-top:.88rem;}
    header.header
        a.backBtn(href="javascript:window.history.go(-1);")
        span 投票详情
    .vote-wrapper
    include ../includes/_tie-comments

block append js
    script(src="/duimen/js/swiper.js")
    script(src='/duimen/js/alertBox.js')
    script(src='/duimen/js/_tie-comments.js')
    script(src="/duimen/js/vote.js")
    script(type="text/html")#vote_tpl.
        <h1>{{postTitle}}</h1>
        <p class="author-time"><em>{{custName}}</em><span>发表于{{postTime}}</span></p>
        <p class="title">{{postContent}}</p>
        {{if attendFlag==0}}
            <div style="position:relative">
                <div class="tie-tu">
                    <div class="swiper-container">
                        <div class="swiper-wrapper">
                            {{each images as image i}}
                                <img src="{{image}}" class="swiper-slide">
                            {{/each}}
                        </div>
                    </div>
                </div>
                <span class="page" style="right:0">1/{{images.length}}</span>
            </div>
            <div class="vote-options" data-itemid="{{voteItemList[0].itemId}}">
                {{if voteItemList[0].optionList[0].images && voteItemList[0].optionList[0].images.length > 0 }}
                    <div class="clearfix">
                        {{each voteItemList[0].optionList as item}}
                            <label class="vote-option-imgs">
                                <input type="checkbox" name="fuck" data-optionid="{{item.optionId}}" data-count="{{item.voteUserCount}}"><span></span><img src="{{item.images[0]}}">
                                <p>{{item.itemContent}}</p>
                            </label>
                        {{/each}}
                    </div>
                {{else}}
                    {{each voteItemList[0].optionList as item}}
                        <label>
                            <input type="checkbox" name="fuck" data-optionid="{{item.optionId}}" data-count="{{item.voteUserCount}}"><span></span><em>{{item.optionName}}</em>
                        </label>
                    {{/each}}
                {{/if}}
            </div>
            <button>确认</button>
        {{else}}
            <div class="vote-wrap">
                <div class="sel-con">
                {{each voteItemList[0].optionList as item}}
                    <div class="vote-detail clearfix">
                        {{if item.images && item.images[0]}}
                            <img src="{{item.images[0]}}" onerror="this.src='/temp/2.png'">
                        {{/if}}
                        <div class="bar">
                            <span class="t-tit">{{item.optionName}}</span>
                            <span class="t-peo">{{item.voteUserCount}}人</span><span class="t-bg">
                            </span>
                        </div>
                    </div>
                {{/each}}
                </div>
            </div>
        {{/if}}